<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>教育背景</title>
</head>
<body>
<div id="div">aaa</div>
</body>
<script src="../assets/js/jquery-1.4.2.min.js"></script>
<script src="../assets/js/pc.js"></script>
<script src="../assets/js/jquery-jtemplates.js"></script>
<script src="../assets/js/My97DatePicker/WdatePicker.js"></script>
</html>
<script>
    window.alert = alert;
    var cc='http://www.baidu.com';
    //    单个按钮
    function alerta(data,d) {
        var a = document.createElement("div"),
                p1=document.createElement("p")
        p1text=document.createTextNode("提示"),
                p = document.createElement("p"),
                btn=document.createElement("div"),
                textNode = document.createTextNode(data ? data : ""),
                btnText = document.createTextNode(d ? d : "");

        css(a,{
            "position" : "fixed",
            "left" : "0",
            "right" : "0",
            "top" : "20%",
            "width" : "439px",
            "border-radius":"15px",
            "background-color" : "#fff",
            "margin" : "0 auto",
            "border":"1px solid red",
        })
        css(p1, {
            "color":"#ff7c66",
            "font-size":"28px",
            "margin-top":"21px",
            "text-align":"center",
        })
        css(p, {
            "color":"#666666",
            "font-size":"26px",
            "margin-top":"32px",
            "margin-left":"32px",
            "word-break":"break-all",
            "width":"373px",
        })
        css(btn, {
            "border-radius":"5px",
            "width":"154px",
            "height":"60px",
            "text-align":"center",
            "line-height":"60px",
            "color":"#fff",
            "background":"#ff7c66",
            "font-size":"24px",
            "border":"1px solid #ccc",
            "margin":"40px auto 30px",
        })
        // 内部结构套入
        p.appendChild(textNode);
        p1.appendChild(p1text);

        btn.appendChild(btnText);
        a.appendChild(p1);
        a.appendChild(p);
        a.appendChild(btn);

        // 整体显示到页面内

        document.getElementsByTagName("body")[0].appendChild(a);

        // 确定绑定点击事件删除标签

        btn.onclick = function() {

            a.parentNode.removeChild(a);

        }

    }
    //    两个按钮
    function alertb(data,b,c,url) {
        var a = document.createElement("div"),
                p1=document.createElement("p")
                p1text=document.createTextNode("提示"),
                p = document.createElement("p"),
                bottom = document.createElement("div"),
                btna=document.createElement("button"),
                btnb=document.createElement("button"),
                textNode = document.createTextNode(data ? data : ""),
                btnaText = document.createTextNode(b ? b : "");
                btnbText = document.createTextNode(c ? c : "");
        // 控制样式
        css(a,{
            "position" : "fixed",
            "left" : "0",
            "right" : "0",
            "top" : "20%",
            "width" : "439px",
            "border-radius":"15px",
            "background-color" : "#fff",
            "margin" : "0 auto",
            "border":"1px solid red",
        })
        css(p1, {
            "color":"#ff7c66",
            "font-size":"28px",
            "margin-top":"21px",
            "text-align":"center",
        })
        css(p, {
            "width":"373px",
            "word-break":"break-all",
            "color":"#666666",
            "font-size":"26px",
            "margin":"0 auto",
            "margin-top":"32px",
            "margin-left":"32px",
        })
        css(bottom,{
            "overflow":"hidden",
            "width":"363px",
            "margin":"40px auto 30px",
        })
        css(btna, {
            "float":"left",
            "background" : "#ff7c66",
            "border-radius":"5px",
            "width":"154px",
            "height":"60px",
            "text-align":"center",
            "line-height":"60px",
            "color":"#ffffff",
            "font-size":"24px",
            "border":"1px solid #ff7c66",
            "margin-right":"53px",

        })
        css(btnb, {
            "float":"left",
            "background" : "#fff",
            "border-radius":"5px",
            "width":"154px",
            "height":"60px",
            "text-align":"center",
            "line-height":"60px",
            "color":"#666666",
            "font-size":"24px",
            "border":"1px solid #eeeeee",

        })
        // 内部结构套入
        p.appendChild(textNode);
        p1.appendChild(p1text);
        bottom.appendChild(btna);
        bottom.appendChild(btnb);
        btna.appendChild(btnaText);
        btnb.appendChild(btnbText);
        a.appendChild(p1);
        a.appendChild(p);
        a.appendChild(bottom);

        // 整体显示到页面内

        document.getElementsByTagName("body")[0].appendChild(a);
//        确定绑定点击事件：
        btna.onclick=function(url){
            window.open(cc,"_self");
        }
//         确定绑定点击事件删除标签

        btnb.onclick = function() {
            a.parentNode.removeChild(a);
        }

    }
    function css(targetObj, cssObj) {

        var str = targetObj.getAttribute("style") ? targetObj.getAttribute("style") : "";

        for(var i in cssObj) {

            str += i + ":" + cssObj[i] + ";";

        }
        targetObj.style.cssText = str;
    }

//
//    alerta("aaaaaaaaaaaaa","确定");
    alertb("请完善你的简历，再投递职位","去完善简历","取消","http://www.baidu.com");

</script>
